package StudyCode.summary.Basic.console;

import java.util.Scanner;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class MaximumWithThreeDouble {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);

		System.out.print("请输入三个double值，中间用空格分割，输入完成回车: ");
		double number1 = input.nextDouble();
		double number2 = input.nextDouble();
		double number3 = input.nextDouble();

		double result = maximum(number1, number2, number3);
		System.out.println("最大值是: " + result);
	}

	private static double maximum(double x, double y, double z) {
		double maximumValue = x;

		if (y > maximumValue)
			maximumValue = y;

		if (z > maximumValue)
			maximumValue = z;

		return maximumValue;
	}
}
